import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs"
const baseUrl = Vue.prototype.$serviceUrl + "/repairInspection"

//巡检记录
export const inspectionRecordApi = {
  // /approveUser/transferApproveUser 转单至上级审批人
  transferApproveUser(id, reason, userId) {
    let data = {
      id,
      reason,
      userId
    }
    return request({
      url: baseUrl + "/approveUser/transferApproveUser",
      method: 'post',
      data: qs.stringify(data)
    })
  },
  // /approveUser/list 获取审批设置列表数据
  getApproveUser(id) {
    let data = {
      id,
    }
    return request({
      url: baseUrl + "/approveUser/getPreApproveUser",
      method: 'post',
      data: qs.stringify(data)
    })
  },
  // regionInfo/list
  getAreaList: function (search) {
    const data = {
      search

    }
    return request({
      url: baseUrl + '/regionInfo/list',
      method: 'post',
      data: qs.stringify(data)
    })
  },
  // /inspectionLog/approve 申请审批

  approve: function (inspectionIds, status, reason) {
    const data = {
      inspectionIds, status, reason
    };
    return request({
      url: baseUrl + "/inspectionLog/approve",
      method: "post",
      data: qs.stringify(data)
    });
  },
  // /inspectionLog/getDetail
  //巡检日志信息详情+审批日志
  getDetail: function (id) {
    const data = {
      id
    };
    return request({
      url: baseUrl + "/inspectionLog/getDetail",
      method: "post",
      data: qs.stringify(data)
    });
  },
  getSchoolList: function () {
    const data = {


    }
    return request({
      url: baseUrl + '/schoolAreaInfo/list',
      method: 'post',
      data: qs.stringify(data)
    })
  },
  List: function (params) {
    return request({
      url: baseUrl + '/inspectionLog/inspectionLog',
      method: 'post',
      data: qs.stringify(params)
    })
  },
  //提取信息
  Get: function (id) {
    const data = {
      id
    };
    return request({
      url: baseUrl + "/systemDictData/get",
      method: "post",
      data: qs.stringify(data)
    });
  },

  // 删除
  Del: function (ids) {
    const data = {
      ids
    }
    return request({
      url: baseUrl + "/systemDictData/delete",
      method: "post",
      data: qs.stringify(data)
    });
  },
  save: function (data) {
    const config = {
      headers: {
        'Content-Type': 'application/json;charset=utf-8'
      },
    }
    return request.post(baseUrl + "/systemDictData/save", data, config)
  }
}